import request from '@/utils/request'

// 获取组织架构数据
export function getDepartmentApi() {
  return request({
    url: '/company/department',
    method: 'get'
  })
}

// 下拉框获取
export function chooseDepartmentApi() {
  return request({
    url: '/sys/user/simple',
    method: 'get'
  })
}

// 添加
export function addDepartmentApi(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

// 编辑回显请求
export function infoDepartmentApi(id) {
  return request({
    url: `/company/department/` + id,
    method: 'get'
  })
}

// 修改
export function editDepartmentApi(data) {
  return request({
    url: '/company/department/' + data.id,
    method: 'put',
    data
  })
}

// 删除
export function deleteDepartmentApi(id) {
  return request({
    url: `/company/department/` + id,
    method: 'delete'
  })
}
